<?php
	session_start();
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Won-松的趣味分享</title>
	<link rel="stylesheet" type="text/css" href="../css/bass.css"/>
	<link rel="stylesheet" type="text/css" href="../css/funstyle.css"/>
</head>
<body>
	<?php
		error_reporting(E_ERROR | E_WARNING | E_PARSE);
		$s = $_SESSION["is_login"];
		if ($s=='ok') {
	?>
	<div class="form">
		<div class="head"><b>添加分类</b></div>
		<?php
			include("../function.php");
			if ($_POST) {
				$conn = conn();
				$class = $_POST['class'];
				$sql = "insert into cata_log values (null,'$class')";
				mysqli_query($conn,$sql);
				header("Location:catalog.php");
			}
		?>
		<form action="" method="post">
			分类内容：<input type="text" name="class" value=""/><br/>
			<input style="width:50px;" type="submit" />
			<a href="catalog.php">返回</a>
		</form>
	<?php
		}
	?>
	</div>
</body>
</html>